package com.ikingtech.framework.sdk.workbench.api;

import com.ikingtech.framework.sdk.base.model.BatchParam;
import com.ikingtech.framework.sdk.core.response.R;
import com.ikingtech.framework.sdk.web.annotation.PostRequest;
import com.ikingtech.framework.sdk.workbench.model.TodoTaskDTO;
import com.ikingtech.framework.sdk.workbench.model.TodoTaskDeleteBatchParamDTO;
import com.ikingtech.framework.sdk.workbench.model.TodoTaskQueryParamDTO;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.web.bind.annotation.RequestBody;

import java.util.List;

/**
 * @author tie yan
 */
public interface TodoTaskApi {

    @PostRequest(order = 1, value = "/add", summary = "新增", description = "新增，新增成功后返回编号。")
    R<String> add(@Parameter(name = "todoTask", description = "待办任务信息")
                  @RequestBody TodoTaskDTO todoTask);

    @PostRequest(order = 1, value = "/add/batch", summary = "批量新增", description = "批量新增，新增成功后返回编号。")
    R<Object> addBatch(@Parameter(name = "todoTasks", description = "待办任务信息")
                       @RequestBody BatchParam<TodoTaskDTO> todoTasks);

    @PostRequest(order = 2, value = "/delete", summary = "删除", description = "删除。")
    R<Object> delete(@Parameter(name = "id", description = "编号")
                     @RequestBody String id);

    @PostRequest(order = 2, value = "/delete/batch", summary = "批量删除", description = "批量删除。")
    R<Object> deleteBatch(@Parameter(name = "deleteParam", description = "批量删除参数")
                          @RequestBody TodoTaskDeleteBatchParamDTO deleteParam);

    @PostRequest(order = 3, value = "/update", summary = "更新", description = "更新。")
    R<Object> update(@Parameter(name = "todoTask", description = "待办任务信息")
                     @RequestBody TodoTaskDTO todoTask);

    @PostRequest(order = 4, value = "/list/page", summary = "分页查询", description = "分页查询，没有查询结果时返回空列表。")
    R<List<TodoTaskDTO>> page(@Parameter(name = "queryParam", description = "查询条件")
                              @RequestBody TodoTaskQueryParamDTO queryParam);

    @PostRequest(order = 5, value = "/list/all", summary = "全量查询", description = "全量查询，没有查询结果时返回空列表。")
    R<List<TodoTaskDTO>> all();

    @PostRequest(order = 6, value = "/detail/id", summary = "查询详情", description = "查询详情，数据不存在时仍然返回成功,数据为null。")
    R<TodoTaskDTO> detail(@Parameter(name = "id", description = "编号")
                          @RequestBody String id);
}
